import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@WebServlet("/Step2")
public class Step2 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset=UTF-8");
        String name = req.getParameter("name");
        String address = req.getParameter("address");
        String username = req.getParameter("username");
//      String visa = req.getParameter("Visa");
//        String master = req.getParameter("Master");
        String[] types = req.getParameterValues("types");

        HttpSession session = req.getSession();
        session.setAttribute("types",types);
        session.setAttribute("name",name);
        session.setAttribute("username",username);
        session.setAttribute("address",address);
        resp.sendRedirect("confirm.jsp");
    }
}

